<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var inpus = document.querySelectorAll("input");

        inpus[1].onclick = function() {
            var num = Number(inpus[0].value);

            num = parseInt(num / 10);
            switch (num) {
                case 10:
                    alert("优秀");
                    break;
                case 9:
                    alert("优秀");
                    break;
                case 8:
                    alert("良好");
                    break;
                case 7:
                    alert("良好");
                    break;
                case 6:
                    alert("及格");
                    break;
                default:
                    alert("不及格");
                    break;
            }

        }
    </script>

</head>

<body>

</body>

</html>